package com.cpi.cornpp.grinddistribution.form;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import com.cpi.cornpp.grinddistribution.view.GrindDistributionView;

public class GrindDistributionForm extends ActionForm {
	private static final long serialVersionUID = -7997862296598868243L;
	private List grindDistributionViews = null;
	
	public GrindDistributionForm(){
		setGrindDistributionViews(new ArrayList(0));
	}

	public void setGrindDistributionViews(List grindDistributionViews) {
		this.grindDistributionViews = grindDistributionViews;
	}

	public List getGrindDistributionViews() {
		return grindDistributionViews;
	}
	
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		Iterator iterator = null;
		GrindDistributionView grindDistributionView = null;
		if(grindDistributionViews!=null){
			iterator = grindDistributionViews.iterator();
			while(iterator.hasNext()){
				grindDistributionView = (GrindDistributionView)iterator.next();
				grindDistributionView.setNewDelivered(new Integer(0));
				grindDistributionView.setNewInventory(new Integer(0));
			}
		}
	}
}